import threading
from werkzeug.local import Local

import time

my_obj = Local()
my_obj.b = 1
def worker():
    my_obj.b = 2
    print('Thread1 is ' + str(my_obj.b))

new_t = threading.Thread(target=worker, name='Thread1')
new_t.start()
time.sleep(1)
print('main Thread is ' + str(my_obj.b))